Optimal. Leaf size=169 \[ -\frac {2 \tan (e+f x) (a \sec (e+f x)+a)^{m+2} (c-c \sec (e+f x))^{-m-3}}{a^2 f (2 m+1) \left (4 m^2+16 m+15\right )}+\frac {2 \tan (e+f x) (a \sec (e+f x)+a)^{m+1} (c-c \sec (e+f x))^{-m-3}}{a f \left (4 m^2+8 m+3\right )}-\frac {\tan (e+f x) (a \sec (e+f x)+a)^m (c-c \sec (e+f x))^{-m-3}}{f (2 m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {3951, 3950} \[ -\frac {2 \tan (e+f x) (a \sec (e+f x)+a)^{m+2} (c-c \sec (e+f x))^{-m-3}}{a^2 f (2 m+1) \left (4 m^2+16 m+15\right )}+\frac {2 \tan (e+f x) (a \sec (e+f x)+a)^{m+1} (c-c \sec (e+f x))^{-m-3}}{a f \left (4 m^2+8 m+3\right )}-\frac {\tan (e+f x) (a \sec (e+f x)+a)^m (c-c \sec (e+f x))^{-m-3}}{f (2 m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3950
Rule 3951
Rubi steps
\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^{-3-m} \, dx &=-\frac {(a+a \sec (e+f x))^m (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{f (1+2 m)}-\frac {2 \int \sec (e+f x) (a+a \sec (e+f x))^{1+m} (c-c \sec (e+f x))^{-3-m} \, dx}{a (1+2 m)}\\ &=-\frac {(a+a \sec (e+f x))^m (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{f (1+2 m)}+\frac {2 (a+a \sec (e+f x))^{1+m} (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{a f \left (3+8 m+4 m^2\right )}+\frac {2 \int \sec (e+f x) (a+a \sec (e+f x))^{2+m} (c-c \sec (e+f x))^{-3-m} \, dx}{a^2 \left (3+8 m+4 m^2\right )}\\ &=-\frac {(a+a \sec (e+f x))^m (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{f (1+2 m)}+\frac {2 (a+a \sec (e+f x))^{1+m} (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{a f \left (3+8 m+4 m^2\right )}-\frac {2 (a+a \sec (e+f x))^{2+m} (c-c \sec (e+f x))^{-3-m} \tan (e+f x)}{a^2 f (5+2 m) \left (3+8 m+4 m^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 9.08, size = 321, normalized size = 1.90 \[ -\frac {i 2^{m+3} \left (1+e^{i (e+f x)}\right ) \left (-i e^{-\frac {1}{2} i (e+f x)} \left (-1+e^{i (e+f x)}\right )\right )^{-2 m} \left (\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}\right )^{-m} \left (\frac {\left (1+e^{i (e+f x)}\right )^2}{1+e^{2 i (e+f x)}}\right )^m \left (\left (4 m^2+12 m+7\right ) e^{4 i (e+f x)}+\left (8 m^2+24 m+22\right ) e^{2 i (e+f x)}-4 (2 m+3) e^{i (e+f x)}-4 (2 m+3) e^{3 i (e+f x)}+4 m^2+12 m+7\right ) \sin ^{-2 (-m-3)}\left (\frac {e}{2}+\frac {f x}{2}\right ) \sec ^{m+3}(e+f x) (\sec (e+f x)+1)^{-m} (a (\sec (e+f x)+1))^m (c-c \sec (e+f x))^{-m-3}}{f (2 m+1) (2 m+3) (2 m+5) \left (-1+e^{i (e+f x)}\right )^5} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 120, normalized size = 0.71 \[ -\frac {{\left ({\left (4 \, m^{2} + 12 \, m + 7\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (2 \, m + 3\right )} \cos \left (f x + e\right ) + 2\right )} \left (\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}\right )^{m} \left (\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}\right )^{-m - 3} \sin \left (f x + e\right )}{{\left (8 \, f m^{3} + 36 \, f m^{2} + 46 \, f m + 15 \, f\right )} \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \sec \left (f x + e\right ) + a\right )}^{m} {\left (-c \sec \left (f x + e\right ) + c\right )}^{-m - 3} \sec \left (f x + e\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 3.88, size = 0, normalized size = 0.00 \[ \int \sec \left (f x +e \right ) \left (a +a \sec \left (f x +e \right )\right )^{m} \left (c -c \sec \left (f x +e \right )\right )^{-3-m}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.66, size = 156, normalized size = 0.92 \[ \frac {{\left ({\left (4 \, m^{2} + 8 \, m + 3\right )} \left (-a\right )^{m} - \frac {2 \, {\left (4 \, m^{2} + 12 \, m + 5\right )} \left (-a\right )^{m} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {{\left (4 \, m^{2} + 16 \, m + 15\right )} \left (-a\right )^{m} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}}\right )} c^{-m - 3} {\left (\cos \left (f x + e\right ) + 1\right )}^{5}}{4 \, {\left (8 \, m^{3} + 36 \, m^{2} + 46 \, m + 15\right )} f \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )^{2 \, m} \sin \left (f x + e\right )^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.65, size = 290, normalized size = 1.72 \[ -\frac {\left (\cos \left (3\,e+3\,f\,x\right )-\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (\frac {\sin \left (e+f\,x\right )\,{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^m\,\left (\cos \left (3\,e+3\,f\,x\right )+\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (4\,m^2+12\,m+15\right )\,2{}\mathrm {i}}{f\,\left (m^3\,8{}\mathrm {i}+m^2\,36{}\mathrm {i}+m\,46{}\mathrm {i}+15{}\mathrm {i}\right )}-\frac {\sin \left (2\,e+2\,f\,x\right )\,\left (8\,m+12\right )\,{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^m\,\left (\cos \left (3\,e+3\,f\,x\right )+\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{f\,\left (m^3\,8{}\mathrm {i}+m^2\,36{}\mathrm {i}+m\,46{}\mathrm {i}+15{}\mathrm {i}\right )}+\frac {\sin \left (3\,e+3\,f\,x\right )\,{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^m\,\left (\cos \left (3\,e+3\,f\,x\right )+\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (4\,m^2+12\,m+7\right )\,2{}\mathrm {i}}{f\,\left (m^3\,8{}\mathrm {i}+m^2\,36{}\mathrm {i}+m\,46{}\mathrm {i}+15{}\mathrm {i}\right )}\right )}{8\,{\cos \left (e+f\,x\right )}^3\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^{m+3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________